home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d3 / amac36.arc / SRQ.BAT < prev    next >
DOS Batch File  |  1991-03-16  |  883b  |  46 lines

  1. @echo off
  2. rem SRQ.BAT for NON-case sensitive search/replace        March 7, 1991
  3. rem Quits each file after replacement
  4.  
  5. rem Requires FGREP.COM
  6. rem Requires INPUT.COM
  7. rem "Enter" without any search or replace text terminates batch file
  8.  
  9. CLS
  10. INPUT Search Text=/b
  11.      IF Errorlevel=1 goto END
  12. SET  FGS=%ANS%
  13. ECHO 
  14. INPUT Replacement Text=/b
  15.      IF Errorlevel=1 goto END
  16. SET  FGR=%ANS%
  17. SET >c:$
  18.  
  19. ECHO 
  20. ECHO Searching For Files Containing '%FGS%' To Replace With '%FGR%'...
  21. ECHO ******** NON-CASE SENSITIVE SEARCH/REPLACE ********
  22. ECHO 
  23. BREAK on
  24.  
  25. if not exist SRCH-FG.LST   GOTO NEXT1
  26. GOTO NEXT2
  27.  
  28. :NEXT1
  29. FGREP  -f /%FGS%/ *.*         >c:$.ql
  30.  
  31. :NEXT2
  32. if exist SRCH-FG.LST GOTO NEXT3
  33. GOTO NEXT4
  34.  
  35. :NEXT3
  36. FGREP -f /%FGS%/ @SRCH-FG.LST >c:$.ql
  37.  
  38. :NEXT4
  39.  
  40. BREAK off
  41. ECHO 
  42. COPY c:$.ql c:!
  43. Q.EXE       c:!    /ESRCH_q.mac  /LSRCH_q.mac
  44. ECHO 
  45. :END
  46.